﻿using Microsoft.Extensions.Options;

namespace Timo.SqlSugar.DbContext;
/// <summary>
/// 使用dbcontext方式，需要每个数据库都建立一个实例
/// </summary>
public abstract class DbContextBase
{
    public readonly SqlSugarClient SugarClient;
    public DbContextBase(IOptionsSnapshot<ConnectionConfig> namedOptionsAccessor)
    {
        SugarClient = new SqlSugarClient(namedOptionsAccessor.Get(this.GetType().Name));
    }
}